Skip to content

Conversation

@IOKG04
Copy link
Contributor

@IOKG04 IOKG04 commented Aug 13, 2025

  1. The doc comment on std.Random.intRangeAtMostBiased() was self-referential, it now points to intRangeAtMost() as the function it is a constant time replacement of. (fixes std.Random.intRangeAtMostBiased documentation references itself #24809)
  2. Resolved in Document that remove of Singly/DoublyLinkedList relies on the node being in the list #25705.
  3. Documented explicitly that @This() doesn't work with tuples. (closes document tuples and their (lack of) interaction with @This() #24599)
  4. Changed @shlExact() and @shrExact() documentation to say Illegal Behavior is caused by shifting out specific bits, not that the "caller guaranties that the shift will not shift any 1 bits out" or that the "result is undefined". Also updated both runtime and comptime error messages for the safety-checked IB to be more specific. (closes docs: @shlExact, @shrExact cause illegal behavior on shifted-out bits #19679)
  5. Documented that @typeInfo(anyerror).error_set == null. (closes Incorrect TypeInfo for anyerror #6891)
  6. Updated the floating point operation mode documentation to use the naming conventions presented in the langref.

Regarding 3, I only added a "non-tuple" before the "struct" in the langref for @This(), if someone has a more descriptive version, I'll gladly take that.
Regarding 5, I added that to the doc comment on the ErrorSet type, if it should be added to the error_set field of Type too, I can do that too.
Regarding 6, I can an argument for keeping snake_case for those functions, readability, but I'd argue that camelCase is also readable and that not conforming to the naming conventions might confuse some people.

If there are any more langref fixes/additions, I can add those too.

IOKG04 added 9 commits August 12, 2025 01:01
- shifting out specific bits is safety-checked Illegal Behavior,
  and doesn't only result in `undefined` (or is "guarantied by the caller")
- unified error messages for comptime and runtime checks
- made said error messages a bit more descriptive

closes ziglang#19679
I can see an argument why it shouldnt, readability,
but I'd argue that consistency is about as important in documentation
and camelCase is still very much readable.

also did a small fix, I forgot a *safety-checked* in `@shrExact()` langreft
didn't know these tests existed ;w;
@squeek502
Copy link
Member

squeek502 commented Oct 26, 2025

In an effort to make this easier to review, I've cherry-picked the linked list documentation commit into its own PR here: #25705

@IOKG04
Copy link
Contributor Author

IOKG04 commented Oct 26, 2025

In an effort to make this easier to review, I've cherry-picked the linked list documentation commit into its own PR

Alright, if yours gets merged, I'll remove it from mine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants